<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>new (Vu::GtkFrame)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File Vu/GtkFrame.rb, line 25</span>
                <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">gtkw</span>)
                        <span class="ruby-keyword kw">super</span>()
                        <span class="ruby-ivar">@gtk_peer</span> = <span class="ruby-identifier">gtkw</span>
                        <span class="ruby-comment cmt"># area needs redrawing</span>
                        <span class="ruby-identifier">gtk_peer</span>.<span class="ruby-identifier">signal_connect</span>(<span class="ruby-value str">&quot;expose-event&quot;</span>) <span class="ruby-keyword kw">do</span>
                                <span class="ruby-identifier">check_for_resize</span>
                                <span class="ruby-identifier">cr</span> = <span class="ruby-identifier">gtk_peer</span>.<span class="ruby-identifier">window</span>.<span class="ruby-identifier">create_cairo_context</span>
                                
                                <span class="ruby-identifier">cr</span>.<span class="ruby-identifier">save</span>
                                <span class="ruby-identifier">cr</span>.<span class="ruby-identifier">operator</span> = <span class="ruby-constant">Cairo</span><span class="ruby-operator">::</span><span class="ruby-constant">Operator</span><span class="ruby-operator">::</span><span class="ruby-constant">CLEAR</span>
                                <span class="ruby-identifier">cr</span>.<span class="ruby-identifier">paint</span>
                                <span class="ruby-identifier">cr</span>.<span class="ruby-identifier">restore</span>
                                
                                <span class="ruby-identifier">render_children</span>(<span class="ruby-identifier">cr</span>)
                        <span class="ruby-keyword kw">end</span>
                        <span class="ruby-comment cmt"># mouse motion</span>
                        <span class="ruby-identifier">gtk_peer</span>.<span class="ruby-identifier">signal_connect</span>(<span class="ruby-value str">&quot;motion-notify-event&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ob</span>, <span class="ruby-identifier">event</span><span class="ruby-operator">|</span>
                                <span class="ruby-identifier">mouse_move</span>(<span class="ruby-identifier">event</span>.<span class="ruby-identifier">x</span>,<span class="ruby-identifier">event</span>.<span class="ruby-identifier">y</span>)
                        <span class="ruby-keyword kw">end</span>
                        <span class="ruby-comment cmt"># mouse exit</span>
                        <span class="ruby-identifier">gtk_peer</span>.<span class="ruby-identifier">signal_connect</span>(<span class="ruby-value str">&quot;leave-notify-event&quot;</span>) <span class="ruby-keyword kw">do</span>
                                <span class="ruby-identifier">mouse_exit</span>
                        <span class="ruby-keyword kw">end</span>
                        <span class="ruby-comment cmt"># mouse button down</span>
                        <span class="ruby-identifier">gtk_peer</span>.<span class="ruby-identifier">signal_connect</span>(<span class="ruby-value str">&quot;button-press-event&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">win</span>, <span class="ruby-identifier">event</span><span class="ruby-operator">|</span>
                                <span class="ruby-identifier">mouse_press</span>(<span class="ruby-identifier">event</span>.<span class="ruby-identifier">button</span>, <span class="ruby-identifier">event</span>.<span class="ruby-identifier">x</span>, <span class="ruby-identifier">event</span>.<span class="ruby-identifier">y</span>)
                        <span class="ruby-keyword kw">end</span>
                        <span class="ruby-comment cmt"># mouse button up</span>
                        <span class="ruby-identifier">gtk_peer</span>.<span class="ruby-identifier">signal_connect</span>(<span class="ruby-value str">&quot;button-release-event&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">win</span>, <span class="ruby-identifier">event</span><span class="ruby-operator">|</span>
                                <span class="ruby-identifier">mouse_release</span>(<span class="ruby-identifier">event</span>.<span class="ruby-identifier">button</span>, <span class="ruby-identifier">event</span>.<span class="ruby-identifier">x</span>, <span class="ruby-identifier">event</span>.<span class="ruby-identifier">y</span>)
                        <span class="ruby-keyword kw">end</span>
                        
                        <span class="ruby-identifier">gtk_peer</span>.<span class="ruby-identifier">set_events</span>(<span class="ruby-constant">Gdk</span><span class="ruby-operator">::</span><span class="ruby-constant">Event</span><span class="ruby-operator">::</span><span class="ruby-constant">ALL_EVENTS_MASK</span>)
                <span class="ruby-keyword kw">end</span></pre>
</body>
</html>